<?php
$section = "user_admin";

$titre = _LB_USER_MANAGEMENT;
$smarty->assign('titre', $titre);

Session::setBackLink($section);
Session::setBackLink("user");

$current_page = Request::getIntNumber('annonceur_startpage');

$nom = Request::get("a_nom");

$page = Request::getIntNumber('page');
if ($page=="")
	$page = 1;

$acc_arr = array();

$myUsr = new Login();
$sql = $myUsr->getUserQuery($nom);
$pager = new DBPager($myUsr, array(), false, PAGING_DEFAULT_ITEM_PER_PAGE, $sql);
$myUsr->query($sql);

while ($myUsr->fetch())
{
	$acc_arr[] = $myUsr->toArray();
}

$link_retour = get_link_retour_4_redirect($section,APPLICATION_URL."/$controller/list/?");
$cfer = new Cfer(array(
	_LB_ACCUEIL => Utils::getHomeLink(),
	_LB_USER_MANAGEMENT => $link_retour));

if ($_SESSION["userClasse"] == "user_support" )
	$chooselist[ACCOUNT_TYPE_SUPPORT] = _LB_SUPPORT	;

// bo begin
$_SERVER['REQUEST_URI'] = urldecode($_SERVER['REQUEST_URI']);
$pos = strpos($_SERVER['REQUEST_URI'],'=');
$return_link = substr($_SERVER['REQUEST_URI'],$pos+1);
$smarty->assign("return_link", $return_link);
// end

// get email and password current login_user
$cur_login_user = new Login();
if ($cur_login_user->getFromIdIgnoreDisabled($_SESSION['userID']))
{
	$smarty->assign("cur_login_user", $cur_login_user);
}

$smarty->assign("cfer", $cfer);
$smarty->assign("list_account", $acc_arr);
$smarty->assign("pager", $pager);
$smarty->assign("nom",$nom);
$smarty->assign("array_size", sizeof($acc_arr));
$smarty->display("user_admin_liste.html");